<template>
  <div class="home_left">
    <component
      v-for="(item, index) in setComponentList"
      :key="index"
      :is="item['component']"
    />
  </div>
</template>

<script>
import { findId } from '../../utils/findId.js'
import { pageLists } from '../../utils/project-pageList'
export default {
  name: 'home-left',
  data() {
    return {
      lists: [],
      componentList: [
        { id: '1-0-0', component: null },
        { id: '1-0-1', component: null },
      ],
    }
  },
  created() {
    this.lists.push(pageLists[0])
  },
  computed: {
    setComponentList() {
      this.componentList.forEach((item) => {
        let findItem = findId(this.lists, item.id)
        item.component = () =>
          import(`@/${findItem.path}/views/${findItem.basePath}`)
      })
      return this.componentList
    },
  },
}
</script>

<style lang="less" scoped>
.home_left {
  width: 20%;
  height: 100%;
  overflow: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
</style>
